package com.atguigu.gmall.publisher.mapper;

import com.atguigu.gmall.publisher.bean.TrafficUvCt;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Author: Felix
 * Date: 2022/6/27
 * Desc: 流量域统计Mapper接口
 */
public interface TrafficStatsMapper {
    //获取某天各个渠道独立访客数排名在前n的
    @Select("select ch,sum(uv_ct) uv_ct from dws_traffic_vc_ch_ar_is_new_page_view_window where toYYYYMMDD(stt)=#{date} group by ch order by uv_ct desc limit #{limit}")
    List<TrafficUvCt> selectTrafficUvCt(@Param("date") Integer date, @Param("limit") Integer limit);
}
